<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>彩票</title>
  <style type="text/css">
    *{margin: 0;padding: 0;box-sizing:border-box;} 
    html {
      color: #000;
      background: #fff;
      overflow-y: scroll;
      -webkit-text-size-adjust: 100%;
      -ms-text-size-adjust: 100%;
    }
    html * {
      outline: none;
      -webkit-text-size-adjust: none;
      -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }
    a:hover {
      text-decoration: underline;
    }
    ins,
    a {
      text-decoration: none;
    }
    .dn{display: none;}
  </style>
  <style type="text/css">
    
    .container{width: 1000px;margin: 0 auto;}
    span{line-height: 30px;border-right: 1px solid #cccccc;font-size:16px;}
    dt span{line-height:40px;}
    section{border: 1px solid #c1c1c1}
    dt{border-top: 1px solid #c1c1c1}
    dt ,dd{border-bottom: 1px solid #c1c1c1}
    h2,h3{line-height:40px;}
    dd{font-size:0;}
    .one dt{}
    .one dd{}
    .one span{display: inline-block;width: 33.3333333333333%;text-align: center;}
    .one dd span:last-child,.one dt span:last-child{border:none}
    .two dt{}
    .two dd{}
    .two span{display: inline-block;width: 16.666666666666%;text-align: center;}
    .two dd span:last-child,.two dt span:last-child{border:none}
    .three dt{}
    .three dd{}
    .three span{display: inline-block;width: 50%;text-align: center;}
    .three dd span:last-child,.three dt span:last-child{border:none}

  </style>
</head>
<body class="container">
 
  <header><h1 >足球</h1></header>
  <% for(var i=0; i<data.length; i++) {%>
    <section >
      <h2 id="btn"><%= data[i].h2.title %> <%= data[i].h2.time %></h2>
      <dl class="one" id="one">
        <dt><span>胜</span><span>胜</span><span>胜</span></dt>
            <dd>
              <% for(var j=0; j<data[i].one.dd.length; j++) {%>
                <span><%= data[i].one.dd[j] %></span>
              <% } %>  
            </dd> 
      </dl>
      <dl class="two dn" id="two">
        <dt><span> </span><span>让球</span><span>赔率</span><span>大小球</span><span>赔率(DA)</span><span>赔率(XIAO)</span></dt>
            <% for(var j=0; j<data[i].two.dd.length; j++) {%>
              <dd>
                <% for(var m=0; m<data[i].two.dd[j].length; m++) {%>
                  <span><%= data[i].two.dd[j][m] %></span>
                <% } %>  
              </dd>
            <% } %>  
      </dl>
      <dl class="three dn" id="three">
      <h3><%= data[i].three.h3 %></h3>
        <dt><span>比分</span><span>比分</span></dt>
          <% for(var j=0; j<data[i].three.dd.length; j++) {%>
              <dd>
                <% for(var m=0; m<data[i].three.dd[j].length; m++) {%>
                  <span><%= data[i].three.dd[j][m] %></span>
                <% } %>  
              </dd>
            <% } %>  
      </dl>
    </section>
  <% } %>  

  <script type="text/javascript">
    var secList = Array.from(document.querySelectorAll("section"));
    for (var i = secList.length - 1; i >= 0; i--) {
       let btn = secList[i].querySelector("#btn");
       let two = secList[i].querySelector(".two");
       let three = secList[i].querySelector(".three");
       btn.addEventListener("click",function(){
         two.classList.toggle("dn");
         three.classList.toggle("dn");
        },
       false)
    }
  </script>
</body>
</html>
